package com.probox.common.entity.domain.customer;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.annotation.Excel;
import com.probox.common.core.utils.money.MoneyUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 客户收益对象 customer_fund
 *
 * @author zsy
 * @date 2021-06-18
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("customer_fund")
@ApiModel(description = "客户收益")
public class CustomerFund implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    //默认主键自增
    @ApiModelProperty(value = "收益ID")
    @TableId(value = "FUND_UID", type = IdType.AUTO)
    private Long fundUid;
    /**
     * 会员ID
     */
    @ApiModelProperty(value = "会员ID")
    @Excel(name = "会员ID")
    private Long customerUid;

    /**
     * 平台ID
     */
    @ApiModelProperty(value = "平台ID")
    private Long platformUid;
    /**
     * 合计收益
     */
    @ApiModelProperty(value = "合计经验值，只增不减")
    @Excel(name = "合计经验值，只增不减")
    private Long allProfit;

    /**
     * 可用收益
     */
    @ApiModelProperty(value = "可用经验值，可增，可减，")
    @Excel(name = "可用经验值，可增，可减，")
    private Long profit;

    /**
     * 冻结收益
     */
    @Deprecated
    @ApiModelProperty(value = "冻结经验值(作废)")
    @Excel(name = "冻结经验值(作废)")
    private Long freezeProfit;

    /**
     * 合计提现
     */
    @ApiModelProperty(value = "合计提现(作废)")
    @Excel(name = "合计提现(作废)")
    private Long allWithdraw;
    /**
     * 总积分
     */
    @ApiModelProperty(value = "总菠萝派，只增不减")
    @Excel(name = "总积分，只增不减")
    private Long allScore;

    /**
     * 可用积分
     */
    @ApiModelProperty(value = "可用积分,可增、可减")
    private Long score;
    /**
     * 冻结积分
     */
    @ApiModelProperty(value = "冻结积分，到账前挂在此处")
    @Excel(name = "冻结积分，待用户确认")
    private Long freezeScore;
    /**
     * 余额
     */
    @ApiModelProperty(value = "总菠萝金币，只增不减")
    @Excel(name = "总菠萝金币，只增不减")
    private Long allBalance;

    /**
     * 可用余额
     */
    @ApiModelProperty(value = "可用菠萝金币,可增、可减，可以用来支付，不能提现，数据来源于充值、兑换码或赠送")
    @Excel(name = "可用菠萝金币")
    private Long balance;

    /**
     * 红包
     */
    @ApiModelProperty(value = "总的排版次数，只增不减")
    @Excel(name = "总的排版次数")
    private Long allRedBag;

    /**
     * 可用红包
     */
    @ApiModelProperty(value = "可用排版次数,可增、可减")
    private Long redBag;

    @ApiModelProperty(value = "冻结排版次数,可增、可减")
    private Long freezeRedBag;

    /**
     * 粉丝数量
     */
    @ApiModelProperty(value = "粉丝数量")
    @Excel(name = "粉丝数量")
    private Integer allFans;
    /**
     * 二级粉丝数量
     */
    @ApiModelProperty(value = "二级粉丝数量")
    @Excel(name = "二级粉丝数量")
    private Integer allFansSecond;

//    /**
//     * 订单总额
//     */
//    @ApiModelProperty(value = "订单总额")
//    @Excel(name = "订单总额")
//    private Long allOrderAmount;
//
//    /**
//     * 支付金额
//     */
//    @ApiModelProperty(value = "支付金额")
//    @Excel(name = "支付金额")
//    private Long allPayAmount;


    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;


    /**
     * 金额处理
     *
     * @return
     */
    public String getBalanceStr() {
        return MoneyUtils.changeF2B(balance);
    }

    public String getRedBagStr() {
        return MoneyUtils.changeF2B(redBag);
    }

    public String getScoreStr() {
        return MoneyUtils.changeF2B(score);
    }


    public String getAllProfitStr() {
        return String.valueOf(allProfit);
        //return MoneyUtils.changeF2B(allProfit);
//        if(allProfit != 0 && allProfit !=null){
//
//        }else {
//            return "0";
//        }

    }

    public String getProfitStr() {
        return String.valueOf(profit);
        //return MoneyUtils.changeF2B(profit);
    }

    public String getfreezeProfitStr() {
        return MoneyUtils.changeF2B(freezeProfit);
    }

    public String getAllWithdrawStr() {
        return MoneyUtils.changeF2B(allWithdraw);
    }

    public String getAllBalanceStr() {
        return MoneyUtils.changeF2B(allBalance);
//        if(allBalance!=0 && allBalance !=null){
//
//        }else {
//            return "0";
//        }

    }

//    public String getAllOrderAmountStr() {
//        return MoneyUtils.changeF2B(allOrderAmount);
//    }
//
//    public String getAllPayAmountStr() {
//        return MoneyUtils.changeF2B(allPayAmount);
//    }

    @TableField(exist = false)
    private Integer yhqNumber;

}
